<!doctype html>
<html lang="zh">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE11" />
	<title>{{$data.title}}</title>
	<meta name="keywords" content="{{$data.title}}" />
	<meta name="description" content="{{$data.title}}" />
	<meta name="LinkArtifact" content="7000c2fd0c1eff6fc7c2d4b66ac23916">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=no">
	<!-- QQ互联 -->
	<meta property="qc:admins" content="3566762547627031606375" />
	<link rel="icon" href="favicon.ico" type="image/x-icon"/>
	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>

	<style type="text/css">
		body {
			_behavior: url({{$smarty.const.APP_URL}}resource/htc/csshover.htc);
		}
	</style>

	<link href="{{$smarty.const.APP_URL}}templates/default/css/base.css" rel="stylesheet" type="text/css">
	<link href="{{$smarty.const.APP_URL}}templates/default/css/home_header.css" rel="stylesheet" type="text/css">
	<link href="{{$smarty.const.APP_URL}}templates/default/css/home_login.css" rel="stylesheet" type="text/css">
	<link href="{{$smarty.const.APP_URL}}templates/default/css/index-new.css" rel="stylesheet" type="text/css">
	<link href="{{$smarty.const.APP_URL}}data/resource/font/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
	<link href="{{$smarty.const.APP_URL}}templates/default/css/spot.css" rel="stylesheet" type="text/css">
	<!--[if IE 7]>
	<link rel="stylesheet" href="{{$smarty.const.APP_URL}}data/resource/font/font-awesome/css/font-awesome-ie7.min.css">
	<![endif]-->
	<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
	<!--[if lt IE 9]>
	<script src="{{$smarty.const.APP_URL}}data/resource/js/html5shiv.js"></script>
	<script src="{{$smarty.const.APP_URL}}data/resource/js/respond.min.js"></script>
	<![endif]-->
	<!--[if IE 6]>
	<script src="{{$smarty.const.APP_URL}}data/resource/js/IE6_PNG.js"></script>
	<script>
		DD_belatedPNG.fix('.pngFix');
	</script>
	<script>
		// <![CDATA[
if((window.navigator.appName.toUpperCase().indexOf("MICROSOFT")>=0)&&(document.execCommand))
try{
document.execCommand("BackgroundImageCache", false, true);
   }
catch(e){}
// ]]>
</script>
<![endif]-->
	<script>
		var COOKIE_PRE = 'BC18_';var _CHARSET = 'utf-8';var SITEURL = '{{$smarty.const.SELF_URL}}';var RESOURCE_URL = '{{$smarty.const.APP_URL}}data/resource';var TEMPLATES_URL = '{{$smarty.const.APP_URL}}templates/default';
	</script>
	<script src="{{$smarty.const.APP_URL}}data/resource/js/jquery/$.js"></script>
	<script src="{{$smarty.const.APP_URL}}data/resource/js/common.js" charset="utf-8"></script>
	<script src="{{$smarty.const.APP_URL}}data/resource/js/jquery/ui/$.ui.js"></script>
	<script src="{{$smarty.const.APP_URL}}data/resource/js/jquery/$.validation.min.js"></script>
	<script src="{{$smarty.const.APP_URL}}data/resource/js/jquery/$.masonry.js"></script>
	<script src="{{$smarty.const.APP_URL}}data/resource/js/dialog/dialog.js" id="dialog_js" charset="utf-8"></script>
	<script>
		$(document).ready(function(){
		//获得文本框对象
		// var t = $("#text_box");
		//初始化数量为1,并失效减
		$('.spot-min').attr('disabled',true);
		    //数量增加操作
		    $(".spot-add").click(function(){    
		        $(this).prev().val(parseInt($(this).prev().val())+1)
		        if (parseInt($(this).prev().val())!=1){
		            $(this).prev().prev().attr('disabled',false);
		        }
		      
		    }) 
		    //数量减少操作
		    $(".spot-min").click(function(){
		        $(this).next().val(parseInt($(this).next().val())-1);
		        if (parseInt($(this).next().val())<=1){
		            $(this).attr('disabled',true);
		        }
		      
		    })
		   
		});
	</script>  
</head>
<body style="min-width: 1200px;">
{{include file="{{$smarty.const.APP_PATH}}Home/View/Public/header.html"}}
<div class="header-wrap-new" style="padding-top:10px;">
	<header class="public-head-layout-new wrapper pr mt20">
		<h1 class="site-logo">
			<a href="{{$smarty.const.SELF_URL}}" target="_blank"><img src="{{$smarty.const.APP_URL}}data/upload/logo/spot.png"></a>
		</h1>
		<div class="tcs pa">
			<i class="tel" onclick="showImage();"></i>
			<i class="code" onclick="showPic();"></i>
		</div>
	</header>
</div>
{{include file="{{$smarty.const.APP_PATH}}Home/View/Public/nav.html"}}
<div class="header-wrap-new" style="background:#efefef;">
	<section class="wrapper">
		<!-- <img src="{{$smarty.const.APP_URL}}templates/default/images/cs/spot_m.jpg" usemap="#map"> -->
		<div class="wrap-top" style="height: 50px;">
			<!--<div class="wrap-top-1">
				地区&nbsp&nbsp
				<select>
					<option>上海</option>
					<option>广州</option>
					<option>深圳</option>
					<option>郴州</option>	
				</select>
				&nbsp&nbsp名称&nbsp
				<input type="text"/>
				&nbsp&nbsp规格&nbsp
				<input type="text"/>
				&nbsp&nbsp产地&nbsp
				<input type="text"/>
				&nbsp&nbsp品牌&nbsp
				<input type="text"/>
				<div class="wrap-top-1-btn" style="float: right;margin-right: 100px;padding-top: 5px;">
					<input type="image" src="{{$smarty.const.APP_URL}}templates/default/images/cs/spot_btn1.png" style="" />
					<input type="image" src="{{$smarty.const.APP_URL}}templates/default/images/cs/spot_btn2.png" style="" />
				</div>
			</div>-->
			<div class="wrap-top-2">
				排序：
				<select id="sort">
					<option selected>请选择排序</option>
					<option value="/spot/index/sort/price-asc">价格↑</option>
					<option value="/spot/index/sort/price-desc">价格↓</option>
					<option value="/spot/index/sort/time-asc">发布时间↑</option>
					<option value="/spot/index/sort/time-desc">发布时间↓</option>
				</select>
				<!--仓库&nbsp&nbsp
				<select>
					<option>广州</option>
					<option>深圳</option>
					<option>郴州</option>	
				</select>
				&nbsp&nbsp数量&nbsp&nbsp<input type="text" size="8"> - <input type="text" size="8">
				&nbsp&nbsp价格&nbsp&nbsp<input type="text" size="8"> - <input type="text" size="8">
				<select id="sort">
					<option selected>请选择排序</option>
					<option value="/spot/index/sort/price-asc">价格↑</option>
					<option value="/spot/index/sort/price-desc">价格↓</option>
					<option value="/spot/index/sort/time-asc">发布时间↑</option>
					<option value="/spot/index/sort/time-desc">发布时间↓</option>
				</select>
				&nbsp&nbsp<a href="/spot/index/sort/sell_num-desc"><span style="border: 1px solid #aaa;margin: 0 5px;padding: 5px 10px;">销量↓</span></a>
				&nbsp&nbsp<a href="/spot/index/sort/price-asc"><span style="border: 1px solid #aaa;margin: 0 5px;padding: 5px 10px;">价格↑</span></a>

				&nbsp&nbsp<button>报价时间↑</button>
				<select>
					<option>交货方式</option>
					<option>先付</option>
					<option>货到付款</option>
				</select>-->
			</div>
		</div>
			<div class="wrap-con">
				{{foreach from=$supply_list item=i}}
				<div class="wrap-con-del">
					<img src="{{if $i.supply_image}}{{$i.supply_image}}{{else}}{{$smarty.const.APP_URL}}templates/default/images/cs/spot_yinding.png{{/if}}" style="float: left;" width="75" height="75"/>
					<div class="wrap-con-del-d wrap50">
						<p class="wrap-con-del-p1">{{$i.pc_name}}</p>
						<p class="wrap-con-del-p2">{{$i.member_area_name}}</p>
					</div>
					<div class="wrap-con-del-d wrap50">
						<p class="wrap-con-del-p1">{{$i.spec_name}}</p>
					</div>
					<div class="wrap-con-del-d wrap80">
						<p class="wrap-con-del-p1">{{$i.depot_name}}</p>
						<p class="wrap-con-del-p2">{{$i.depot_area_name}}</p>
					</div>
					<div class="wrap-con-del-d wrap120">
						<p class="wrap-con-del-p1">{{$i.deliver_time_title}}</p>
						<p class="wrap-con-del-p2">{{$i.deliver_type_title}}|{{$i.shipping_type_title}}</p>
					</div>
					<div class="wrap-con-del-d wrap100">
						<p class="wrap-con-del-p1">{{$i.supply_stock}}{{$i.unit_name}}</p>
						<p class="wrap-con-del-p2">起订：{{$i.supply_mininum}}{{$i.unit_name}}</p>
					</div>
					<div class="wrap-con-del-d wrap100">
						<p class="wrap-con-del-p1"><span style="color: #FA6C00;">￥{{$i.supply_price}}</span>元/{{$i.unit_name}}</p>
						<p class="wrap-con-del-p1"><span style="background: #FA6C00;color: #fff;padding: 1px;">现</span></p>
					</div>
					<div class="wrap-con-del-d wrap60">
						<p>{{$i.time_to_word}}</p>
					</div>
					<div class="wrap-con-del-d wrap120">
						<input class="spot-min" name="" type="button" value="-" />  
						<input id="num_{{$i.supply_id}}" class="text_box" name="" type="text" value="1"style="width:25px;text-align: center;"/>
						<input class="spot-add" name="" type="button" value="+" />  
					</div>
					<div class="wrap-con-del-d1">
						<div class="wrap-con-del-btn1 cuohe" id="{{$i.supply_id}}">进入撮合</div>
						<!--<a href="#"><div class="wrap-con-del-btn2">直接采购</div></a>-->
					</div>
				</div>
				{{/foreach}}
			<div class="wrap-con-page">
				<a href="{{$base_url}}"><span class="wrap-con-page-btn1">首页</span></a>
				{{if $pager.current_page>$pager.last_page}}
				<a href="{{$base_url}}/page/{{$pager.last_page}}"><span class="wrap-con-page-btn1">上一页</span></a>
				{{/if}}
				{{if $pager.current_page<=10&&$pager.page_total<=10}}
				{{section name=loop loop=$pager.page_total}}
				<a href="{{$base_url}}/page/{{$smarty.section.loop.index+1}}">
					<span class="wrap-con-page-btn2" {{if $smarty.section.loop.index+1==$pager.current_page}}style="color:#fff;background:#FA6C00;"{{/if}}>{{$smarty.section.loop.index+1}}</span>
				</a>
				{{/section}}
				{{else if $pager.current_page>10&&$pager.current_page+10<$pager.page_total}}
				{{section name=loop loop=$pager.current_page+10 start=($pager.current_page/10)|string_format:"%d"*10}}
				<a href="{{$base_url}}/page/{{$smarty.section.loop.index+1}}">
					<span class="wrap-con-page-btn2" {{if $smarty.section.loop.index+1==$pager.current_page}}style="color:#fff;background:#FA6C00;"{{/if}}>{{$smarty.section.loop.index+1}}</span>
				</a>
				{{/section}}
				{{else if $pager.current_page>10&&$pager.current_page+10>$pager.page_total}}
				{{section name=loop loop=$pager.page_total start=($pager.current_page/10)|string_format:"%d"*10}}
				<a href="{{$base_url}}/page/{{$smarty.section.loop.index+1}}">
					<span class="wrap-con-page-btn2" {{if $smarty.section.loop.index+1==$pager.current_page}}style="color:#fff;background:#FA6C00;"{{/if}}>{{$smarty.section.loop.index+1}}</span>
				</a>
				{{/section}}
				{{else}}
				{{section name=loop loop=10}}
				<a href="{{$base_url}}/page/{{$smarty.section.loop.index+1}}">
					<span class="wrap-con-page-btn2" {{if $smarty.section.loop.index+1==$pager.current_page}}style="color:#fff;background:#FA6C00;"{{/if}}>{{$smarty.section.loop.index+1}}</span>
				</a>
				{{/section}}
				{{/if}}
				{{if $pager.current_page<$pager.next_page}}
				<a href="{{$base_url}}/page/{{$pager.next_page}}"><span class="wrap-con-page-btn1">下一页</span></a>
				<a href="{{$base_url}}/page/{{$pager.page_total}}"><span class="wrap-con-page-btn1">尾页</span></a>
				{{/if}}
			</div>
		</div>
	</section>
</div>
<div class="header-wrap-new" style="background:#FFF; height:10px;"></div>
{{include file="{{$smarty.const.APP_PATH}}Home/View/Public/footer.html"}}
<div id="mask" class="mask"></div>
<div class="content">    
	<p style="font-size: 15px;font-weight: bold;border-bottom: 1px solid #ccc;">我要采购</p>
	<div>
		<table class="content_tab">
			<tr>
				<td>类目：</td>
				<td id="pc_name">Loading...</td>
				<td>规格：</td>
				<td id="spec_name">Loading...</td>
			</tr>
			<tr>
				<td>品牌：</td>
				<td id="brand_name">Loading...</td>
				<td>单价：</td>
				<td id="supply_price">Loading...</td>
			</tr>
			<tr>
				<td>库存：</td>
				<td id="supply_stock">Loading...</td>
				<td>起订量：</td>
				<td id="supply_mininum">Loading...</td>
			</tr>
			<tr>
				<td>所属地区：</td>
				<td id="supply_area_name">Loading...</td>
				<td>物流类型：</td>
				<td id="supply_shipping_type_title">Loading...</td>
			</tr>
			<tr>
				<td>采购数量：</td>
				<td id="num">Loading...</td>
				<td>价格：</td>
				<td id="price_total">Loading...</td>
			</tr>
			<tr>
				<td>备注：</td>
				<td colspan="3">
					<textarea id="purchase_desc" name="" style="width: 270px;height: 100px;resize: none;"></textarea>
				</td>
			</tr>
			<tr>
				<td colspan="4" style="color: #F94101;">
					您好，请在备注栏填写备注信息并提交，谢谢。
				</td>
			</tr>
			<tr>
				<td colspan="3"></td>
				<td align="right">
					<input id="member_id" value="{{$member_id}}" type="hidden">
					<input id="supply_id" value="" type="hidden">
					<input id="purchase_num" value="" type="hidden">
					<input id="submit" type="button" value="提交" style="width: 60px;height: 30px;" />
				</td>
			</tr>
		</table>
		<div class="detail-sider">
					<p style="font-weight: bold;">我的交易员</p>
					<div style="margin-top: 10px;">
						<img src="{{$smarty.const.APP_URL}}templates/default/images/mall/spot_kefu.png" style="float: left;width: 103px;height: 103px;">
						<div style="padding: 30px 10px;float: left;">
							<p style="font-size: 13px;">您好，我是客服</p>
							<p style="font-size: 13px;">很高兴为您服务！</p>
						</div>
					</div>
					<div style="clear: both;"></div>
					<table style="margin-top: 10px;">
						<tr height="30px">
							<td width="50px" height="30px">工&nbsp&nbsp&nbsp&nbsp号：</td>
							<td>001</td>
						</tr>
						<tr height="30px">
							<td>姓&nbsp&nbsp&nbsp&nbsp名：</td>
							<td>客服</td>
						</tr>
						<tr height="30px" height="30px">
							<td>Q&nbsp&nbsp&nbsp&nbsp Q：</td>
							<td>QQ交谈</td>
						</tr>
						<tr height="30px">
							<td>座&nbsp&nbsp&nbsp&nbsp机：</td>
							<td>0735-2659812</td>
						</tr>
						<tr height="30px">
							<td>户&nbsp&nbsp&nbsp&nbsp名：</td>
							<td>湖南省郴州市金福银贵科技有限公司</td>
						</tr>
						<tr height="30px">
							<td>账&nbsp&nbsp&nbsp&nbsp号：</td>
							<td>9558 8088 8808 888</td>
						</tr>
						<tr height="30px">
							<td>开户行：</td>
							<td>建设银行白露塘支行</td>
						</tr>
					</table>
				</div>
	</div>     
	<span id="close">x</span>    
</div>    
<!-- End Save for Web Slices -->

<!-- 选项卡js -->
<script type="text/javascript">
	$(document).ready(function(){
		var $nav_span=$(".detail-main-content-nav span");
		$nav_span.click(function(){
			$(this).css({color:"#fff",background:"#FF6E03"}).siblings().css({color:"#000",background:"#fff"});
			var nav_id=$(this).attr("id");
			if(nav_id=='con_nav1'){
				$("#detail_xq").show().siblings().hide();
			} 
			else if(nav_id=='con_nav2'){
				$("#detail_jl").show().siblings().hide();
			}
			else if(nav_id=='con_nav3'){
				$("#detail_pl").show().siblings().hide();
			}
		});
	});
	//撮合，点击弹出窗口
	$(function(){    
		$(".cuohe").click(function(){
			//AJAX获取数据
			var supply_id=this.id;
			var num=$('#num_'+supply_id).val(); //数量
			var url='/spot/get_ajax_data';
			$.ajax({
				url: url ,
				data:{
					supply_id:supply_id
				},
				type:'POST',
				cache:false,
				dataType:'json',
				success:function(data) {
					if(data.msg =="ok" ){
						//显示窗口
						$("#mask").css({
							"height":$(document).height(),
							"width":$(document).width()
						}).show();
						$(".content").show();
						//显示数据
						$('#pc_name').html(data.info.pc_name);  //类目
						$('#spec_name').html(data.info.spec_name);  //规格
						$('#brand_name').html(data.info.brand_name);  //品牌
						$('#supply_price').html(data.info.supply_price+'元/'+data.info.unit_name);  //单价
						$('#supply_stock').html(data.info.supply_stock+data.info.unit_name);  //库存
						$('#supply_mininum').html(data.info.supply_mininum+data.info.unit_name);  //起订量
						$('#supply_area_name').html(data.info.supply_area_name);  //所属地区
						$('#supply_shipping_type_title').html(data.info.supply_shipping_type_title);  //物流类型
						$('#num').html(num+data.info.unit_name);  //数量
						$('#price_total').html(data.info.supply_price*num+'元');  //价格
						//以下用于提交
						$('#supply_id').val(supply_id); //供货ID
						$('#purchase_num').val(num);  //采购数量
					}else{
						alert(data.msg);
						window.location.href='/user/login';return;
					}
				},
				error : function() {
					alert("异常！");
				}
			});
		});
		//关闭
		$("#close").click(function(){
			$(".content").hide();    
			$("#mask").hide();    
		});
		//提交 写入采购表及撮合表
		$("#submit").click(function(){
			var member_id=$('#member_id').val();  //用户ID
			var supply_id=$('#supply_id').val();
			var purchase_num=$('#purchase_num').val();
			var purchase_desc=$('#purchase_desc').val();
			//alert(purchase_desc);return;
			var url='/spot/submit_ajax_data';
			$.ajax({
				url: url ,
				data:{
					member_id:member_id,
					supply_id:supply_id,
					purchase_num:purchase_num,
					purchase_desc:purchase_desc
				},
				type:'POST',
				cache:false,
				dataType:'json',
				success:function(data) {
					if(data.msg =="ok" ){
						alert('提交成功');
						$(".content").hide();
						$("#mask").hide();
						return;
					}else{
						alert(data.msg);
						window.location.href='/user/login';return;
					}
				},
				error : function() {
					alert("异常！");
				}
			});
		});
	});
	//下拉列表 跳转 排序
	$(document).ready(function () {
		$("#sort").bind("change",function(){
			var url=$(this).val();
			//alert(url);return;
			window.location.href=url;
		});
	});

	
            
</script>
</body>
</html>